import 'package:flutter/cupertino.dart';
import 'package:flutter/services.dart';

class NativeBridge {
  // 定义 Channel 名称（需与 iOS 端一致）
  static const platform = MethodChannel('com.weather.quickly.report');

  // 调用 iOS 原生方法
  Future<String> getDeviceInfo() async {
    try {
      // 调用原生方法 "getInstallInfo"，并等待返回结果
      final String deviceInfo = await platform.invokeMethod('getInstallInfo');
      return deviceInfo;
    } on PlatformException catch (e) {
      // 处理异常
      debugPrint("Failed to get device info: '${e.message}'.");
      return "Failed: ${e.message}";
    }
  }
}